package com.libaoxuan.blog.controller;

import com.libaoxuan.blog.service.impl.SysUserServiceImpl;
import com.libaoxuan.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("users")
public class UsersController {

    @Autowired
    SysUserServiceImpl sysUserService;

    @GetMapping("currentUser")
    public Result currentUser(@RequestHeader("Authorization") String token) {
        return sysUserService.getUserInfoByToken(token);
    }

}
